2010 IF BS$(I)="BOXFIL" AND COL(I)>=0 AND COL(I)<=7 THEN LINE(HX(I),HY(I))-(HDX(I),HDY(I)),PSET,COL(I),BF
2020 IF BS$(I)="BOXFIL" AND COL(I)>=8 AND COL(I)<=15 THEN C=COL(I)-8:LINE(HX(I),HY(I))-(HDX(I),HDY(I)),PSET,%C,BF
2030 IF BS$(I)="CONNECT" AND COL(I)>=0 AND COL(I)<=7 THEN LINE(HX(I),HY(I))-(HDX(I),HDY(I)),PSET,COL(I),BF:X1=HX(I):Y1=HY(I):X2=HDX(I):Y2=HDY(I):GOSUB *CONNECT
2040 IF BS$(I)="CONNECT" AND COL(I)>=8 AND COL(I)<=15 THEN C=COL(I)-8:LINE(HX(I),HY(I))-(HDX(I),HDY(I)),PSET,%C,BF:X1=HX(I):Y1=HY(I):X2=HDX(I):Y2=HDY(I):GOSUB *CONNECT
2050 IF BS$(I)="CONNECT2" AND COL(I)>=0 AND COL(I)<=7 THEN LINE(HX(I),HY(I))-(HDX(I),HDY(I)),PSET,COL(I),BF:X1=HX(I):Y1=HY(I):X2=HDX(I):Y2=HDY(I):GOSUB *CONNECT2
2060 IF BS$(I)="CONNECT2" AND COL(I)>=8 AND COL(I)<=15 THEN C=COL(I)-8:LINE(HX(I),HY(I))-(HDX(I),HDY(I)),PSET,%C,BF:X1=HX(I):Y1=HY(I):X2=HDX(I):Y2=HDY(I):GOSUB *CONNECT2
2070 IF BS$(I)="CONNECTR" AND COL(I)>=0 AND COL(I)<=7 THEN LINE(HX(I),HY(I))-(HDX(I),HDY(I)),PSET,COL(I),BF:X1=HX(I):Y1=HY(I):X2=HDX(I):Y2=HDY(I):GOSUB *CONNECTR
2080 IF BS$(I)="CONNECTR" AND COL(I)>=8 AND COL(I)<=15 THEN C=COL(I)-8:LINE(HX(I),HY(I))-(HDX(I),HDY(I)),PSET,%C,BF:X1=HX(I):Y1=HY(I):X2=HDX(I):Y2=HDY(I):GOSUB *CONNECTR
2090 IF BS$(I)="CONNECT2R" AND COL(I)>=0 AND COL(I)<=7 THEN LINE(HX(I),HY(I))-(HDX(I),HDY(I)),PSET,COL(I),BF:X1=HX(I):Y1=HY(I):X2=HDX(I):Y2=HDY(I):GOSUB *CONNECT2R
2100 IF BS$(I)="CONNECT2R" AND COL(I)>=8 AND COL(I)<=15 THEN C=COL(I)-8:LINE(HX(I),HY(I))-(HDX(I),HDY(I)),PSET,%C,BF:X1=HX(I):Y1=HY(I):X2=HDX(I):Y2=HDY(I):GOSUB *CONNECT2R
2110 IF BS$(I)="FMTOWNS" THEN PUT@A(HX(I),HY(I))-(HDX(I),HDY(I)),FMTOWNS,MATTE,,,0
2120 IF BS$(I)="MCONNECT" AND COL(I)>=0 AND COL(I)<=7 THEN LINE(HX(I),HY(I))-(HDX(I),HDY(I)),PSET,COL(I),BF:X1=HX(I):Y1=HY(I):X2=HDX(I):Y2=HDY(I):GOSUB *CONNECT
2130 IF BS$(I)="MCONNECT" AND COL(I)>=8 AND COL(I)<=15 THEN C=COL(I)-8:LINE(HX(I),HY(I))-(HDX(I),HDY(I)),PSET,%C,BF:X1=HX(I):Y1=HY(I):X2=HDX(I):Y2=HDY(I):GOSUB *CONNECT
2140 IF BS$(I)="MCONNECT2" AND COL(I)>=0 AND COL(I)<=7 THEN LINE(HX(I),HY(I))-(HDX(I),HDY(I)),PSET,COL(I),BF:X1=HX(I):Y1=HY(I):X2=HDX(I):Y2=HDY(I):GOSUB *CONNECT2
2150 IF BS$(I)="MCONNECT2" AND COL(I)>=8 AND COL(I)<=15 THEN C=COL(I)-8:LINE(HX(I),HY(I))-(HDX(I),HDY(I)),PSET,%C,BF:X1=HX(I):Y1=HY(I):X2=HDX(I):Y2=HDY(I):GOSUB *CONNECT2
2160 IF BS$(I)="MCONNECTR" AND COL(I)>=0 AND COL(I)<=7 THEN LINE(HX(I),HY(I))-(HDX(I),HDY(I)),PSET,COL(I),BF:X1=HX(I):Y1=HY(I):X2=HDX(I):Y2=HDY(I):GOSUB *CONNECTR
2170 IF BS$(I)="MCONNECTR" AND COL(I)>=8 AND COL(I)<=15 THEN C=COL(I)-8:LINE(HX(I),HY(I))-(HDX(I),HDY(I)),PSET,%C,BF:X1=HX(I):Y1=HY(I):X2=HDX(I):Y2=HDY(I):GOSUB *CONNECTR
2180 IF BS$(I)="MCONNECT2R" AND COL(I)>=0 AND COL(I)<=7 THEN LINE(HX(I),HY(I))-(HDX(I),HDY(I)),PSET,COL(I),BF:X1=HX(I):Y1=HY(I):X2=HDX(I):Y2=HDY(I):GOSUB *CONNECT2R
2190 IF BS$(I)="MCONNECT2R" AND COL(I)>=8 AND COL(I)<=15 THEN C=COL(I)-8:LINE(HX(I),HY(I))-(HDX(I),HDY(I)),PSET,%C,BF:X1=HX(I):Y1=HY(I):X2=HDX(I):Y2=HDY(I):GOSUB *CONNECT2R
2200 IF BS$(I)="MOJI" AND COL(I)>=0 AND COL(I)<=7 THEN SYMBOL(HX(I),HY(I)),MOJI$(I),.75!,.75!,COL(I)
2210 IF BS$(I)="MOJI" AND COL(I)>=8 AND COL(I)<=15 THEN C=COL(I)-8:SYMBOL(HX(I),HY(I)),MOJI$(I),.75!,.75!,%C
2220 IF BS$(I)="EXIT" THEN PUT@A(HX(I),HY(I))-(HDX(I),HDY(I)),EXIT,MATTE,,,0
2230 IF BS$(I)="SANKAKU" THEN PUT@A(HX(I),HY(I))-(HDX(I),HDY(I)),SANKAKU,MATTE,,,0
2240 NEXT
2250 RETURN
2260 *ボタン処理
2270 IF PUSHB(HMX)=2 THEN *BOTTONXOR
2280 IF PUSHB(HMX)=1 THEN *BOTTONH
2290 IF COL(HMX)<=7 AND COL(HMX)>=0 AND BS$(HMX)="CONNECT" THEN LINE(HX(HMX),HY(HMX))-(HDX(HMX),HDY(HMX)),PSET,COL(HMX),B
2300 IF COL(HMX)<=15 AND COL(HMX)>=8 AND BS$(HMX)="CONNECT" THEN C=COL(HMX)-8:LINE(HX(HMX),HY(HMX))-(HDX(HMX),HDY(HMX)),PSET,%C,B
2310 IF COL(HMX)<=7 AND COL(HMX)>=0 AND BS$(HMX)="CONNECT2" THEN
2320 FOR I=0 TO 1:LINE(HX(HMX)+I,HY(HMX)+I)-(HDX(HMX)-I,HDY(HMX)-I),PSET,COL(HMX),B:NEXT
2330 ENDIF
2340 IF COL(HMX)<=15 AND COL(HMX)>=8 AND BS$(HMX)="CONNECT2" THEN
2350 C=COL(HMX)-8:FOR I=0 TO 1:LINE(HX(HMX)+I,HY(HMX)+I)-(HDX(HMX)-I,HDY(HMX)-I),PSET,%C,B:NEXT
2360 ENDIF
2370 IF COL(HMX)<=7 AND COL(HMX)>=0 AND BS$(HMX)="CONNECTR" THEN LINE(HX(HMX),HY(HMX))-(HDX(HMX),HDY(HMX)),PSET,COL(HMX),BF
2380 IF COL(HMX)<=15 AND COL(HMX)>=8 AND BS$(HMX)="CONNECTR" THEN C=COL(HMX)-8:LINE(HX(HMX),HY(HMX))-(HDX(HMX),HDY(HMX)),PSET,%C,B
2390 IF COL(HMX)<=7 AND COL(HMX)>=0 AND BS$(HMX)="CONNECT2R" THEN
2400 FOR I=0 TO 1:LINE(HX(HMX)+I,HY(HMX)+I)-(HDX(HMX)-I,HDY(HMX)-I),PSET,COL(HMX),B:NEXT
2410 ENDIF
2420 IF COL(HMX)<=15 AND COL(HMX)>=8 AND BS$(HMX)="CONNECT2R" THEN
2430 C=COL(HMX)-8:FOR I=0 TO 1:LINE(HX(HMX)+I,HY(HMX)+I)-(HDX(HMX)-I,HDY(HMX)-I),PSET,%C,B:NEXT
2440 ENDIF
2450 WHILE MOUSE(2,0)=-1:MX=MOUSE(0):MY=MOUSE(1)
2460 IF MX>=HX(HMX) AND MY>=HY(HMX) AND MX<=HDX(HMX) AND MY<=HDY(HMX) THEN
2470 ELSE
2480 IF BS$(HMX)="CONNECT" THEN X1=HX(HMX):Y1=HY(HMX):X2=HDX(HMX):Y2=HDY(HMX):GOSUB *CONNECT
2490 IF BS$(HMX)="CONNECT2" THEN X1=HX(HMX):Y1=HY(HMX):X2=HDX(HMX):Y2=HDY(HMX):GOSUB *CONNECT2
2500 IF BS$(HMX)="CONNECTR" THEN X1=HX(HMX):Y1=HY(HMX):X2=HDX(HMX):Y2=HDY(HMX):GOSUB *CONNECTR
2510 IF BS$(HMX)="CONNECT2R" THEN X1=HX(HMX):Y1=HY(HMX):X2=HDX(HMX):Y2=HDY(HMX):GOSUB *CONNECT2R
2520 RETURN:ENDIF
2530 WEND
2540 IF BS$(HMX)="CONNECT" THEN X1=HX(HMX):Y1=HY(HMX):X2=HDX(HMX):Y2=HDY(HMX):GOSUB *CONNECT
2550 IF BS$(HMX)="CONNECT2" THEN X1=HX(HMX):Y1=HY(HMX):X2=HDX(HMX):Y2=HDY(HMX):GOSUB *CONNECT2
2560 IF BS$(HMX)="CONNECTR" THEN X1=HX(HMX):Y1=HY(HMX):X2=HDX(HMX):Y2=HDY(HMX):GOSUB *CONNECTR
2570 IF BS$(HMX)="CONNECT2R" THEN X1=HX(HMX):Y1=HY(HMX):X2=HDX(HMX):Y2=HDY(HMX):GOSUB *CONNECT2R